﻿
using SqlSugar;

namespace PLM.ConfigurationCenter.Model {

    [SugarTable("dbserver")]
    public class ServerModel {
        /// <summary>
        /// 主键标识
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]//数据库是自增才配自增 
        public string Id { set; get; }
        /// <summary>
        /// 网站名称
        /// </summary>
        [SugarColumn(ColumnDescription = "网站名称")]
        public string SiteLabel { set; get; }
        /// <summary>
        /// 网站代号
        /// </summary>
        [SugarColumn(ColumnDescription = "网站代号", IsNullable = true)]
        public string SiteName { set; get; }
        /// <summary>
        /// 运行端口
        /// </summary>
        [SugarColumn(ColumnDescription = "运行端口", IsNullable = true)]
        public int SitePort { set; get; }
        /// <summary>
        /// 运行状态
        /// </summary>
        [SugarColumn(ColumnDescription = "运行状态", IsNullable = true)]
        public string SiteState { set; get; }
        /// <summary>
        /// 运行状态
        /// </summary>
        [SugarColumn(ColumnDescription = "运行状态", IsNullable = true)]
        public string AppPoolState { set; get; }
        /// <summary>
        /// 状态
        /// 0 未配置 1：已配置,未初始化  2:已初始化,未部署 3：已部署 未运行, 4 已运行
        /// </summary>
        [SugarColumn(ColumnDescription = "状态")]
        public int Status { set; get; } = 0;

        #region 额外的字段
        /// <summary>
        /// 错误信息
        /// </summary>
        [SugarColumn(ColumnDescription = "错误信息", IsNullable = true)]
        public string ErrorStr { set; get; }
        /// <summary>
        /// 状态： false 未部署 True:已部署
        /// </summary>
        [SugarColumn(ColumnDescription = "状态", IsNullable = true)]
        public bool ServerStatus { set; get; } = false;
        /// <summary>
        /// 网站地址
        /// </summary>
        [SugarColumn(ColumnDescription = "网站地址", IsNullable = true)]
        public string IpAddress { set; get; }
        /// <summary>
        /// 标记
        /// </summary>
        [SugarColumn(ColumnDescription = "标记")]
        public string Tag { set; get; }
        #endregion
    }
}
